UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wd89uqmmtIHwolSBB0/2Shy6KVHwdhQ8aQV0W+U1mbU='
WHERE
key_id = '65e06353f09ec6d398d8d96af57f7f3ed887192be1f64aed3554d5ecb1fd0155'
AND (
token = 'Wd89uqmmtIHwolSBB0/2Shy6KVHwdhQ8aQV0W+U1mbU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)