UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ri+K4DSaP5M/1jEzyHrVcmfciadr+M12bjZ87rJT5Wk='
WHERE
key_id = '3b236be8399f414cc2e27a1bd491bbc13cde910c7f4f6dcbf1b8f41e6f97a25c'
AND (
token = 'Ri+K4DSaP5M/1jEzyHrVcmfciadr+M12bjZ87rJT5Wk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)