UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VMMdPQi7grg93VSFpDN1D/YnyCCBkP9StkNEod+c57Y='
WHERE
key_id = 'd00fba4b9bae9478b432cbe1f47180d3064e76bd98b92b768da7bdff6444e246'
AND (
token = 'VMMdPQi7grg93VSFpDN1D/YnyCCBkP9StkNEod+c57Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)