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