UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fiTi6rwNS6kAkWL96QCWgIpcQzb0z7G2G3f03h3q5Hc='
WHERE
key_id = '07ad824da15a423f174654392e31d54496f93a3f2e0cecc3dd3aa35e8675e40c'
AND (
token = 'fiTi6rwNS6kAkWL96QCWgIpcQzb0z7G2G3f03h3q5Hc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)