UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kTG6M8xNBs6KblIgR6NS8NceRIJn4HhsgLvwBJnR/dQ='
WHERE
key_id = 'da6704834500c5891ba5c0ae360b71476220fcd03ade68c1676e7f346945ca61'
AND (
token = 'kTG6M8xNBs6KblIgR6NS8NceRIJn4HhsgLvwBJnR/dQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)