UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sEX/qwUKz3Vp8O7auksCIJMQc8vcxnKzwF8JefBfujc='
WHERE
key_id = '0f20073ed0c8d59e93e3109e5c9aac81c74e9777de15c0bd455a9fa81441cde3'
AND (
token = 'sEX/qwUKz3Vp8O7auksCIJMQc8vcxnKzwF8JefBfujc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)