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