UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LESFyiONFYAW86mPY2WAZyw38Iqcca1IfCBSRtpLwt0='
WHERE
key_id = '97c50232d1ad8b43483d7cf2ab5d8a42841dbffa822261ab1d606a90a9e88e2f'
AND (
token = 'LESFyiONFYAW86mPY2WAZyw38Iqcca1IfCBSRtpLwt0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)