UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2tb+RxF1+DCEY8ko/Dp2FcrBsu4SHEVsPjUkx+RQ1Sw='
WHERE
key_id = '1a2653d8a51d102fbeb330bc21600dfd14530f93bd9841cb7e743d0f222f3afc'
AND (
token = '2tb+RxF1+DCEY8ko/Dp2FcrBsu4SHEVsPjUkx+RQ1Sw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)