UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7ML5O8Z30sJghVMBx7rdqnjyI+TQRZT5azOdMCOivA='
WHERE
key_id = '8036d8f01f1b89a5df9c9a3f5da1a029533f8ce3292575fc770cc2b13c9dda39'
AND (
token = 'i7ML5O8Z30sJghVMBx7rdqnjyI+TQRZT5azOdMCOivA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)