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