UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TFBl9U7gNbbe7TLovYVE+NfGq1nsRhhyaMDB4Da7pcg='
WHERE
key_id = '7cdf02d0bd4227e817680cef47637786c7e116cff55fb9870048ba3f743a7cb8'
AND (
token = 'TFBl9U7gNbbe7TLovYVE+NfGq1nsRhhyaMDB4Da7pcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)