UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm78U7/BCQLhFexiYDENDRjBZinRRz5leRXml+vloW9Q='
WHERE
key_id = 'db26ccb8b62d06a5b49ad0496ffb5a552e2219af1c45ca00da350f4d195c464c'
AND (
token = 'm78U7/BCQLhFexiYDENDRjBZinRRz5leRXml+vloW9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)