UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2s2D6+yHe3shROaVl1uaB8IN1obmHEPYbda4UTro1G0=' 
WHERE 
  key_id = '7f63f95433169406de5c038f777b61a5a3cf2719d3f1a73b901829947f4aff61' 
  AND (
    token = '2s2D6+yHe3shROaVl1uaB8IN1obmHEPYbda4UTro1G0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033