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

Query time 0.00035