UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x0XVLzbKGg8HfLzg+96CyEaRjKuUfNccbs5/lOrYvj0=' 
WHERE 
  key_id = 'ef431c27c3bb78f4b5907550134b16f1ef375cb8200fefbf81a39eaafa7a3cf4' 
  AND (
    token = 'x0XVLzbKGg8HfLzg+96CyEaRjKuUfNccbs5/lOrYvj0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041