UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nK4/5MPB234xlMWPYwFVAHj6AmLbOYXGw9h+cobl1So=' 
WHERE 
  key_id = '9484ec248c10728f8785b2472caa4b784614de19517d6958c468bc725b7ea650' 
  AND (
    token = 'nK4/5MPB234xlMWPYwFVAHj6AmLbOYXGw9h+cobl1So=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018