UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vnnzZqih4x/rQL6MBT5kCqdEdC55cmL6DgOnz/tKISA='
WHERE
key_id = 'ec8768ca03c16eb32fdddfcd5928ed96fa8c9220fc244535147a1125773db613'
AND (
token = 'vnnzZqih4x/rQL6MBT5kCqdEdC55cmL6DgOnz/tKISA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)