UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+3V/TVFgCWS+dAV/+G0Gsf4RNEa4v0EYT/pM6HcK7/4=' 
WHERE 
  key_id = '763bb5e2e09f6b8f8895593404a38173b279339fcdc5a33a810b5eb61465445c' 
  AND (
    token = '+3V/TVFgCWS+dAV/+G0Gsf4RNEa4v0EYT/pM6HcK7/4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034