UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FwSDMCtZADQ8ksDDv2XyqnSoLiKfXlVna8cgSFbdo+8='
WHERE
key_id = '84d29e3460021d9cec59d51472dc53b2a535aae8a35c0711b897dd415ded5f01'
AND (
token = 'FwSDMCtZADQ8ksDDv2XyqnSoLiKfXlVna8cgSFbdo+8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)