UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KQViOfpyurCYDMIFWrxS1S1yvAH068r+bmmdQuA0Lqw='
WHERE
key_id = '5d62809217403803ace1c88b4401e0fa3c811d0f691eaf689ecda2560fd22e2f'
AND (
token = 'KQViOfpyurCYDMIFWrxS1S1yvAH068r+bmmdQuA0Lqw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)