UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'M+J0chZi30FHZvPmIIdVYnpIjDQ7VSeavkE72Z6OJjg='
WHERE
key_id = '801fbc5d2412ba35f830c1a09724953704507063de123eda64da1b9bf28ea09c'
AND (
token = 'M+J0chZi30FHZvPmIIdVYnpIjDQ7VSeavkE72Z6OJjg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)