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