UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qEtHd7GOYTIr32JSa4Qk1AAbGUlIUCkFbTCDjOmHK3c='
WHERE
key_id = 'ce81cbc74300f6fe06649a306d82b5830e12e0cc6f550b31e73ad1142c196953'
AND (
token = 'qEtHd7GOYTIr32JSa4Qk1AAbGUlIUCkFbTCDjOmHK3c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)