UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IzkN2FCA++bMWf0uHDpAFMCQTum460vg7Fmdzvv4FL0='
WHERE
key_id = '8e7c3a15ff7c2ced71ce3e0a1dd4e9e7a91c21920b11d9340df0a812748c3229'
AND (
token = 'IzkN2FCA++bMWf0uHDpAFMCQTum460vg7Fmdzvv4FL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)