UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V/Xje+6ZdwBya5ZrwVIYKs2uGkVqqfWfyhAnon/zCh4='
WHERE
key_id = 'ce14d8e9b54f60c61897ec100c7b8ede7a5aac1e29ce073825879437bbb8683f'
AND (
token = 'V/Xje+6ZdwBya5ZrwVIYKs2uGkVqqfWfyhAnon/zCh4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)