UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Os3nfLwTYjEbTude/h07FgwPL89UYoWRTgbNVMFfe7I='
WHERE
key_id = 'e53d8184a778b5fab2029763c5a4391930acc023acf74af563ca45513dc9c0bb'
AND (
token = 'Os3nfLwTYjEbTude/h07FgwPL89UYoWRTgbNVMFfe7I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)