UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjajemfTMm5wdTb0TC5kJf2yWK6RvhEXVdZLMD5sUCo='
WHERE
key_id = 'f323a9f337d87b87a2fe45490c61fdde53d8bd4752a4dde368493520ed90ddd8'
AND (
token = 'sjajemfTMm5wdTb0TC5kJf2yWK6RvhEXVdZLMD5sUCo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)