UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hqD/bs7G5HMB+s4/IF4y5gPsqbouvBn+PF7i+/JBr1s='
WHERE
key_id = 'cefcdc257c5606983add010e44213391fbd1675a6c87ca9b8989dec7760ce341'
AND (
token = 'hqD/bs7G5HMB+s4/IF4y5gPsqbouvBn+PF7i+/JBr1s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)